#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 110;
int l[maxn];
int r[maxn];
char s[maxn][maxn];
int flag[maxn];
int sel[maxn];
int ans[maxn];
int main()
{
	int n,len;
	cin>>n>>len;
	memset(flag,0,sizeof(flag));
	for(int i = 0;i<n;i++)
	{
		cin>>s[i];
	}
	int cnt = 0;
	int cc = 0;
	for(int i = 0;i<n;i++)
	{
		if(!flag[i])
		{
			for(int j = i+1;j<n;j++)
			{
				if(!flag[j])
				{
					int sign = 0;
					int f,k;
					for(f =0,k =len-1;f<len;f++,k--)
					{
						if(s[i][f]!=s[j][k])
						{
							sign=1;
							break;
						}
					}
					if(!sign)
					{
						flag[j] = 1;
						flag[i] = 1;
						l[cnt] = i;
						r[cnt] = j;
						cnt++;
					}
				}
			}
		}
		if(!flag[i])
		{
			//cout<<i<<endl;
			//cout<<"*******"<<endl;
			int sign = 0;
			int f,k;
			for(f = 0,k = len-1;f<len;f++,k--)
			{
				if(s[i][f]!=s[i][k])
				{
					sign = 1;
					break;
				}
			}
			if(!sign)
			{
				sel[cc++] = i;
			} 
		}
	}
	if(!cnt&&!cc) cout<<"0"<<endl<<endl;
	else 
	{
		int kk = 0;
		for(int i = 0;i<cnt;i++)
		{
			ans[kk++] = l[i];
		}
		if(cc) ans[kk++] = sel[0];
		for(int i = cnt-1;i>=0;i--)
		{
			ans[kk++] = r[i];
		}
		cout<<kk*len<<endl;
		for(int i = 0;i<kk;i++)
		{
			cout<<s[ans[i]];
		}
		cout<<endl;
	}
}
